@extends('app')

@section('content')
<ul class="nav nav-tabs">
    <li class="active"><a href="{{ url('/admin/teaches/organization/class')}}">信息列表</a></li>
    <li><a href="{{ url('/admin/teaches/organization/class/create') }}">信息添加</a></li>
</ul>

<div class="panel panel-info mt20">
    <div class="panel-heading">筛选</div>
    <div class="panel-body">
        <form action="{{ url('/admin/teaches/organization/class')}}" method="get" class="form-horizontal" role="form" id="form1">
            <div class="input-group">
                <div class="input-group-addon">课程名称</div>
                <input class="form-control" name="title" type="text" value="{{$title}}" placeholder="课程名称">
                <div class="input-group-addon">机构名称</div>
                <input class="form-control" name="orgname" type="text" value="{{$orgname}}" placeholder="机构名称">
                
            </div>
            <div class="form-group mt10">
                <div class="col-md-1 col-xs-12">
                    <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="panel panel-default mt20">
    <div class="table-responsive panel-body">
        <table class="table table-hover">
            <thead>
            <tr>
                <th>编号</th>
                <th>名称</th>
                <th>机构</th>
                <th>费用</th>
                <th>评分</th>
                <th>效果</th>
                <th>师资</th>
                <th>环境</th>
                <th>发布时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            @foreach($news as $res)
            <tr id="news_{{ $res->id }}">
                <td>{{ $res->id }}</td>
                <td><a href="{{ url('admin/teaches/organization/class/'.$res->id.'/edit') }}">{{ $res->name }} </a></td>
                <td>{{ count($res->organization)?$res->organization->name:'机构已被删除' }}</td>
                <td>{{ $res->cost}}</td>
                <td>{{ $res->score}}星</td>
                <td>{{ $res->effect}}</td>
                <td>{{ $res->teachers}}</td>
                <td>{{ $res->environment}}</td>
                <td>{{ $res->updated_at}}</td>
                <td>
                    <a href="{{ url('/admin/teaches/organization/class/'.$res->id.'/edit') }}"><i class="glyphicon glyphicon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                    <a href="javascript:void(0);" onclick="delete_one('/admin/teaches/organization/class/{{$res->id}}','{{$res->id}}','{{ csrf_token() }}')"><i class="glyphicon glyphicon-remove-sign"></i></a>
                </td>
            </tr>
            @endforeach
            </tbody>
        </table>
   </div>
</div>
<div>{!! $news->render() !!} </div>
@endsection
